package com.lancoo.ccas52.pojo.response.request;

import cn.hutool.core.collection.ListUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @ClassName NoticeBody
 * @Description 学校通知
 * @Author quin
 * @Date 2023/5/11 11:48
 */
@Data
@Builder
@Accessors(chain = true)
public class NoticeBody {
    @JsonProperty("title")
    private String title;
    @JsonProperty("content")
    private String content;
    @JsonProperty("noticeType")
    private String noticeType;
    @JsonProperty("receiverType")
    private String receiverType;
    @JsonProperty("userId")
    private String userId;
    @JsonProperty("userName")
    private String userName;
    @JsonProperty("identityCode")
    private String identityCode;
    @JsonProperty("identityName")
    private String identityName;
    @JsonProperty("startTime")
    private String startTime;
    @JsonProperty("endTime")
    private String endTime;
    @JsonProperty("sysId")
    private String sysId;
    @JsonProperty("schoolId")
    private String schoolId;
    @JsonProperty("schoolType")
    private Integer schoolType;
    @JsonProperty("receiver")
    private ReceiverDTO receiver;

    @Data
    @Builder
    public static class ReceiverDTO {
        @JsonProperty("identities")
        private List<IdentitiesDTO> identities;

        private List<PersonsDTO> persons;

        @Builder
        @Data
        public static class IdentitiesDTO {
            @JsonProperty("identityCode")
            private String identityCode;
            @JsonProperty("identityName")
            private String identityName;
        }

        @Builder
        @Data
        public static class PersonsDTO {
            @JsonProperty("userId")
            private String userId;
            @JsonProperty("userName")
            private String userName;
            private String photoPath;
        }
    }

    public static NoticeBody getStudentNoticeTemple() {
        return NoticeBody.builder()
                .noticeType("2")
                .receiverType("部分学生")
                .identityCode("IC0002")
                .identityName("教务管理员")
                .sysId("E31")
                .schoolType(1)
                .build();
    }


}
